﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace h1
{
    public partial class Form_mibao : Form
    {
        string ans;
        string select;
        Form_getUser form;
        public Form_mibao()
        {
            InitializeComponent();
        }
        public Form_mibao(string ques,string ans, string note,string message,string select)
        {
            InitializeComponent();
            label5.Text= ques;
            label3.Text= (note=="")?"（空）":note;
            label4.Text= message;
            this.ans = ans;
            this.select = select;
        }
        private void button1_Click(object sender, EventArgs e)
        {
            if(textBox2.Text.Length == 0)
            {
                errorProvider1.SetError(textBox2, "请输入密保答案！");
            }
            else
            {
                errorProvider1.Clear();
                if (textBox2.Text == ans)
                {
                    Form_resetPassword fr = new Form_resetPassword(select);
                    fr.ShowDialog();
                    this.Close();
                }
                else
                {
                    Form_message fm = new Form_message("找回失败！", "密保答案不一致！");
                    fm.ShowDialog();
                }
            }
        }
    }
}
